<template>
    <div class="headerBox">
        <div class="logo" @click="$router.push('/')">
            <img src="../../../assets/image/logo.jpg" alt="">
        </div>
        <div class="content">
            <router-link to="/home">HOME</router-link>
            <router-link to="/men">MEN</router-link>
            <router-link to="/women">WOMEN</router-link>
            <router-link to="/about">ABOUT</router-link>
            <router-link to="/contact">CONTACT</router-link>
        </div>

        <div class="btn" @click="drawer = true">
            <img src="../../../assets/image/expand-btn.png" alt="">
        </div>
    </div>

    <el-drawer v-model="drawer" title="" @click="drawer=false" direction="rtl" size="50%">
        <div class="content2">
            <router-link to="/home">HOME</router-link>
            <router-link to="/men">MEN</router-link>
            <router-link to="/women">WOMEN</router-link>
            <router-link to="/about">ABOUT</router-link>
            <router-link to="/contact">CONTACT</router-link>
        </div>
    </el-drawer>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const drawer = ref(false)
</script>

<style lang="scss" scoped>
@media screen and (max-width:790px) {
    .btn{
        display: block !important;
    }

    .content{
        display: none !important;
    }
}

.btn {
    margin-right: 40px;
    display: none;
}

.headerBox {
    width: 100vw;
    height: 110px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    background-color: white;
    z-index: 100;

    overflow: hidden;

    .logo {
        // margin-left: 35px;

        overflow: hidden;

        img{
            width: 240px;
            // overflow: hidden;
        }
    }

    .content {
        // background-color: red;

        margin-right: 10px;
        display: flex;

    }

    .router-link-active {
        color: black;

        &::after {
            opacity: 1;
        }
    }

    a {
        color: #666666;
        text-decoration: none;
        margin-right: 75px;
        display: block;
        position: relative;

        &::after {
            content: '';
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            bottom: -5px;
            width: 30px;
            height: 2px;
            background: #666666;
            transition: all .4s;
            opacity: 0;
        }

        &:hover {
            color: black;

            &::after {
                background-color: black;
                opacity: 1;
            }
        }
    }

}

.content2 {
    display: flex;
    flex-direction: column;
    align-items: center;

    .router-link-active {
        color: black;

        &::after {
            opacity: 1;
        }
    }

    a {
        // display: block
        font-size: 20px;
        color: #666666;
        text-decoration: none;
        // margin-right: 75px;
        display: block;
        height: 70px;
        position: relative;

        &::after {
            content: '';
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            bottom: 30px;
            width: 30px;
            height: 4px;
            background: #666666;
            transition: all .4s;
            opacity: 0;
        }

        &:hover {
            color: black;

            &::after {
                background-color: black;
                opacity: 1;
            }
        }
    }
}
</style>